<template>
  <!-- 过敏史 -->
  <table width="100%" border="0">
    <tr v-for="(item,index) in value" :key="index">
      <td :is="isComponent" v-model="item.allergens" type="1"></td>
      <td :is="isComponent" v-model="item.allergicReaction" type="2"></td>
      <td :is="isComponent" v-model="item.allergicDegree" type="3"></td>
      <td width="150">
        <el-button @click="onMinus(index)"><i class="el-icon-minus"></i></el-button>
      </td>
    </tr>
    <tr>
      <td>
        <el-button @click="onAdd"><i class="el-icon-plus"></i></el-button>
      </td>
    </tr>
  </table>
</template>
<script>
export default {
  props: ["value", "isAdd"],
  components: {
    guoMinShiItem: () => import("./_com/guoMinShiItem.vue")
  },
  data() {
    return {
      isComponent: "guoMinShiItem"
    };
  },
  mounted() {
    let th = this;
  },
  methods: {
    onAdd() {
      let th = this;
      th.$emit("onAdd");
    },
    onMinus(index) {
      let th = this;
      th.value.splice(index, 1);
      th.$emit("input", th.value);
    }
  },
  watch: {}
};
</script>
